package com.sky.com.common.result;

import lombok.Data;

@Data
// 定义一个结果集
public class JsonResult {
    private Integer code;
    private String msg;
    private Object data;

    public JsonResult() {
    }

    public JsonResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static JsonResult sucess(Object data) {
        return new JsonResult(1, "操作成功", data);
    }

    public static JsonResult error(String msg) {
        return new JsonResult(0, msg, null);
    }

}
